We'll say that a "mirror" section in an array is a group of continuous elements such that somewhere in the array, the same group appears in reverse order. For example, the largest mirror section in {1, 2, 3, 8, 9, 3, 2, 1} is length 3 (the {1, 2, 3} part). Return the size of the largest mirror section found in the given array.
Input Format
The length and element of the array are given, each separated by a carriage return.
Sample Input
8
1
2
3
8
9
3
2
1
Output Format The size of the largest mirror section found in the given array.
Sample Output
3
You must be logged in to submit a solution.